package com.qf.job;

import org.quartz.*;

import java.util.Date;

/**
 * 自定义的工作实现的类
 * @author lixu
 */
public class MyJob implements Job {



    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        Scheduler scheduler = jobExecutionContext.getScheduler();
        try {
            System.out.println("Quartz入门程序:时间:" + new Date() + "::" + scheduler.getSchedulerName());
        } catch (SchedulerException e) {
            throw new RuntimeException(e);
        }
/*        try {
            scheduler.clear();
        } catch (SchedulerException e) {
            throw new RuntimeException(e);
        }*/
        Trigger trigger = jobExecutionContext.getTrigger();
        //删除数据库

    }
}
